import yaml

#带测试用例编号key一起读取！
#返回值：[{},{}]
def read_cesiData(file_name, key):#List[Dict]
    with open(file_name, "r") as f:
        data = yaml.load(f,Loader=yaml.FullLoader)[key]
        ret = list()
        for k in data.keys():
            v=data[k];
            v["key"]=k;
            ret.append(v);
        return ret


#测试
# datas=read_cesiData("../data/login.yaml","test_lgin_001")
# print(datas)



#返回值是Dict
def readConfig(file_path):
    with open(file_path, 'r') as file:
        config_data = yaml.safe_load(file)
    return config_data


# a=readConfig("../config/webConfig.yaml")
# print(a)



